﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CVSA.Suporte.Sinacor.BMFBovespa.Negocio;
using CVSA.Suporte.Sinacor.BMFBovespa.Entidades;
using System.Data;
using System.Data.Odbc;
using System.Configuration;

namespace CVSA.Suporte.Sinacor.BMFBovespa.ConsultaRemedy
{
    public partial class DownloadXMLRelatorioSemanal : System.Web.UI.Page
    {
        private List<Chamado> chamados = new List<Chamado>();
        private Remedy remedy = new Remedy();

        protected void Page_Load(object sender, EventArgs e)
        {
            string Path = Server.MapPath("/") + @"dsChamadosRemedy.xsd";

            string strSql = " where trunc(data_abertura) >= to_date('01/01/2010', 'dd/MM/yyyy')";
            DataSet ds = new DataSet();
            DataTable odt = remedy.ObterChamadosDB(strSql);
            odt.Columns.Remove("DESCRICAO");
            odt.Columns.Remove("RESOLUCAO");
            odt.Columns.Remove("DETALHE");
            //odt.Columns.Remove("AREA_DESIGNADA");
            odt.Columns.Remove("DTULTIMAINTERACAO");
            odt.Columns.Remove("DTINSERCAO");
            odt.Columns.Remove("DTATUALIZACAO");
            //odt.Columns.Remove("DTFECHAMENTO");
            odt.Columns.Remove("PESSOA_DESIGNADA");
            ds.Tables.Add(odt);

            ds.WriteXml(Path);
            Response.WriteFile(Path);
            
        }
    }
}
